<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .parent{

            display: flex;


            width:550px;
            height:380px;
            background-color: darkblue;
        }
        .item{
           /*控制元素的宽度是否能够被压缩，如果值为1，元素的宽度可以被压缩，默认为1*/
            flex-shrink: 1;
            width:100px;
            height:100px;
            background-color: darkgoldenrod;
        }
        .parent .item:nth-child(3){
            /*会把容器的剩余部分分成四分，其中2分设置给该元素*/
            background-color: #004b00;
          flex-shrink: 0;/*0是我的宽度不能被压缩*/
        }

    </style>
</head>
<body>
<div class="parent">
    <div class="item">1</div>
    <div class="item" style="background-color: saddlebrown">2</div>
    <div class="item">3</div>
    <div class="item">1</div>
    <div class="item" style="background-color: saddlebrown">2</div>
    <div class="item">3</div>
    <div class="item">1</div>
    <div class="item" style="background-color: saddlebrown">2</div>
    <div class="item">3</div>


</div>
</body>
</html>